<template>
  <div></div>
</template>

<script>
import { userSimulateLogin } from '@/api/index'
import { mapActions } from 'vuex'
export default {
  created() {
    this.init()
  },
  methods: {
    ...mapActions(['simulatelogin']),
    async init() {
      const simulateloginToken = this.$route.query.token
      localStorage.setItem("bmwToken", simulateloginToken)
      const { data: token } = await userSimulateLogin(simulateloginToken)
      localStorage.setItem('loginType',JSON.stringify('1'))
      this.simulatelogin(token.token)
      this.loginSuccess()
    },
    loginSuccess() {
      this.$router.push({ path: '/' })
    },
  }
}
</script>

<style></style>